package com.tang.websocket.v1.message;

import com.alibaba.fastjson.JSON;

/**
 * @author Tang
 * @classname WebSocketMessage
 * @description [  ]
 * @date 2022/11/25 17:00
 */
public abstract class WebSocketMessage<T> {

    public T payLoad;

    public Integer cmd;

    public WebSocketMessage(T payLoad) {
        this.payLoad = payLoad;
    }

    public T getPayLoad() {
        return payLoad;
    }

    public abstract Integer getCmd();

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
